package com.oi.eksekutif.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.JoinColumn;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author jasoet
 */
@Entity
@Table
public class Pengemudi implements Serializable {

    @Id
    @GeneratedValue
    private Long id;
    @Column(length = 20, unique = true, nullable = false)
    @NotNull
    @Size(min = 1, max = 25)
    private String nomorKpp;
    @Column(length = 65, unique = true,nullable = false)
    @NotNull
    private String nama;
    @ManyToOne
    @JoinColumn(nullable = false)
    @NotNull
    private Posisi posisi;
    @Column(length = 255, nullable = false)
    @NotNull
    private String alamat;
    @Column(length = 15, nullable = false)
    @NotNull
    private String nomorTelp;
    @Column(length = 55, unique = true, nullable = false)
    @NotNull
    private String nomorSim;
    @Column(length = 55, unique = true, nullable = false)
    @NotNull
    private String nomorKtp;
    @Temporal(javax.persistence.TemporalType.DATE)
    @NotNull
    @Column(nullable = false)
    private Date tanggalAwalMasuk;
    @Lob
    private byte[] foto;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAlamat() {
        return alamat;
    }

    public void setAlamat(String alamat) {
        this.alamat = alamat;
    }

    public String getNama() {
        return nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }

    public String getNomorKpp() {
        return nomorKpp;
    }

    public void setNomorKpp(String nomorKpp) {
        this.nomorKpp = nomorKpp;
    }

    public String getNomorKtp() {
        return nomorKtp;
    }

    public void setNomorKtp(String nomorKtp) {
        this.nomorKtp = nomorKtp;
    }

    public String getNomorSim() {
        return nomorSim;
    }

    public void setNomorSim(String nomorSim) {
        this.nomorSim = nomorSim;
    }

    public String getNomorTelp() {
        return nomorTelp;
    }

    public void setNomorTelp(String nomorTelp) {
        this.nomorTelp = nomorTelp;
    }

    public Posisi getPosisi() {
        return posisi;
    }

    public void setPosisi(Posisi posisi) {
        this.posisi = posisi;
    }

    public Date getTanggalAwalMasuk() {
        return tanggalAwalMasuk;
    }

    public void setTanggalAwalMasuk(Date tanggalAwalMasuk) {
        this.tanggalAwalMasuk = tanggalAwalMasuk;
    }

    public byte[] getFoto() {
        return foto;
    }

    public void setFoto(byte[] foto) {
        this.foto = foto;
    }
}
